package com.acme.bankapp.service.bank;

import com.acme.bankapp.domain.bank.Bank;
import com.acme.bankapp.domain.bank.Client;

public class BankService {
	
	static public void addClient(Bank bank, Client client){
		bank.addClient(client);
	}
	
	static public boolean isAClietnOfBank(Bank bank,Client client){
		return bank.getClient(client) != null ? true : false;
	}
	
	static public Bank createNewBank(){
		return new Bank();
	}
	
	static public void printBalance(Bank bank){
		for (Client client : bank.getClients()) {
			if(client == null)
				continue;
			System.out.println(client);
		}
		
	}
	
	static public void printMaximumAmountToWithdraw(Bank bank){
		for (Client client : bank.getClients()) {
			if(client == null)
				continue;
			System.out.println("maximumAmountToWithdraw = " + client.getAccount().maximumAmountToWithdraw());
		}
	}
}
